package com.wxl.common.bean

class ScanLeiGuanBean {
    var state:String
    var progress:Int
    var number:Int
    var stateCode:Int
    var mVoltage:Int
    var mElectric:Int

    constructor(
        state: String,
        progress: Int,
        number: Int,
        stateCode: Int,
        mVoltage: Int,
        mElectric: Int
    ) {
        this.state = state
        this.progress = progress
        this.number = number
        this.stateCode = stateCode
        this.mVoltage = mVoltage
        this.mElectric = mElectric
    }

    companion object {
        fun parse(data:String):ScanLeiGuanBean{
            val state: String = data.substring(20, 22)
            val progress = Integer.valueOf(data.substring(22, 24), 16)
            val number = Integer.valueOf(data.substring(24, 28), 16)
            val stateCode = Integer.valueOf(data.substring(28, 30), 16)
            val mVoltage = Integer.valueOf(data.substring(12, 16), 16)
            val mElectric = Integer.valueOf(data.substring(16, 20), 16)
            return ScanLeiGuanBean(state, progress, number, stateCode, mVoltage, mElectric)
        }
    }

}